/**
 * 杂项：添加BP（废牌）
 * @param card_number     牌号
 * @param dx              起始点x坐标
 * @param dy              起始点Y坐标
 * @param operating_uid   操作人
 * @param gop_delete      是否删除GOP？
 */
function add_bp( card_number , dx , dy , operating_uid , gop_delete ) {
    var temp  = cc.Sprite.create( "res/yida/" + card_number + ".png" );
    var mx = 0; var my = 0;
    temp.x = dx;temp.y = dy;
    if( gop_delete == true ) {
        for (var i = 0; i < GAME_OUT_PAI.length; i++) {
            PL_Room_Play.removeChild(GAME_OUT_PAI[i]);
        }
    }
    PL_Room_Play.addChild( temp );
    if( operating_uid == PB_USER_UID ){//如果出牌人是自己
        if( ZJ_CPS > (PASS_PAI_C-1) ){mx      = 150 + ( SMALL_PAI_H  * (ZJ_CPS-PASS_PAI_C) );}else{mx      = 150 + ( SMALL_PAI_H  * ZJ_CPS );}
        if( ZJ_CPS > (PASS_PAI_C-1) ){my      = SMALL_PAI_H * 2 - 5;}else{my      = SMALL_PAI_H - 5;}
        temp.runAction( cc.MoveTo.create( 0.2 , cc.p( mx , my ) ) );
        MISCE.push( temp );//添加杂项
        ZJ_CPS++;//本家弃牌数+1
    }
    if( operating_uid == ROOM_WS_XJ ){//如果出牌人是下家
        if( XJ_CPS > (PASS_PAI_C-1) ){mx      = PL_Room_Play.realy_size.width - 150 -   ( XJ_CPS *  SMALL_PAI_H - (PASS_PAI_C * SMALL_PAI_H) );}else{mx      = PL_Room_Play.realy_size.width - 150 - ( XJ_CPS * SMALL_PAI_H );}
        if( XJ_CPS > (PASS_PAI_C-1) ){my      = SMALL_PAI_H * 2 - 5;}else{my      = SMALL_PAI_H - 5;}
        temp.runAction( cc.MoveTo.create( 0.2 , cc.p( mx , my ) ) );
        MISCE.push( temp );//添加杂项
        XJ_CPS++;//下家弃牌数+1
    }
    if( operating_uid == ROOM_WS_SJ ){//如果出牌人是上家
        if( SJ_CPS > (PASS_PAI_C-1) ){mx      = TOP_LEFT_NAME_X + ( SMALL_PAI_H * (SJ_CPS - PASS_PAI_C) );}else{mx      = TOP_LEFT_NAME_X + ( SMALL_PAI_H * SJ_CPS );}
        if( SJ_CPS > (PASS_PAI_C-1) ){my      = PL_Room_Play.realy_size.height - TOP_LEFT_NAME_Y - SMALL_PAI_H;}else{my      = PL_Room_Play.realy_size.height - TOP_LEFT_NAME_Y;}
        temp.runAction( cc.MoveTo.create( 0.2 , cc.p( mx , my ) ) );
        MISCE.push( temp );//添加杂项
        SJ_CPS++;//上家棋牌数+1
    }
    if( operating_uid == ROOM_WS_DM ){//如果出牌人是对门
        if( DM_CPS > (PASS_PAI_C-1) ){mx      = PL_Room_Play.realy_size.width - TOP_RIGHT_NAME_X  - ( DM_CPS *  SMALL_PAI_H - (PASS_PAI_C * SMALL_PAI_H ) );}else{mx      = PL_Room_Play.realy_size.width - TOP_RIGHT_NAME_X - ( SMALL_PAI_H * DM_CPS );}
        if( DM_CPS > (PASS_PAI_C-1) ){my      = PL_Room_Play.realy_size.height - TOP_RIGHT_NAME_Y - SMALL_PAI_H;}else{my      = PL_Room_Play.realy_size.height - TOP_RIGHT_NAME_Y;}
        temp.runAction( cc.MoveTo.create( 0.2 , cc.p( mx , my ) ) );
        MISCE.push( temp );//添加杂项
        DM_CPS++;//对门出牌数+1
    }
}

/***************************************  各类对牌的操作的提示按钮  ******************************************************/
function show_tripAND_sound( trip_type , trip_uid , is_chongpao ){
    var self = PL_Room_Play;
    var x = 0; var y = 0;
    var temp_trip = cc.Sprite.create( res['TRIP_' + trip_type] );
    temp_trip.setScale(0.2);
    self.addChild( temp_trip );
    if( trip_uid == PB_USER_UID ){
        x = 220;
        y = 220;
    }
    if( trip_uid == ROOM_WS_XJ ){
        x = self.realy_size.width - 220;
        y = 220;
    }
    if( trip_uid == ROOM_WS_SJ ){
        x = 220;
        y = self.realy_size.height - 220;
    }
    if( trip_uid == ROOM_WS_DM ){
        x = self.realy_size.width - 220;
        y = self.realy_size.height - 220;
    }
    temp_trip.x = x;
    temp_trip.y = y;
    temp_trip.runAction( cc.sequence(cc.scaleTo(0.2,1)) );
    PL_Room_Play.scheduleOnce( show_tripAND_sound_schedule_close , 1.7 );
    PL_Room_Play.temp_trip.push( temp_trip );
    MISCE.push( temp_trip );
}
function show_tripAND_sound_schedule_close() {
    for( var i = 0 ; i < PL_Room_Play.temp_trip.length ; i++ ){
        PL_Room_Play.removeChild( PL_Room_Play.temp_trip[i] );
    }
}
/***************************************  各类对牌的操作的提示按钮  ******************************************************/